package com.shq.mymvp.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.mvp.shq.washer.entity.News;
import com.mvp.shq.washer.entity.shop.Product;
import com.mvp.shq.washer.entity.shop.ProductComment;
import com.mvp.shq.washer.entity.shop.ShopAttr;
import com.mvp.shq.washer.entity.shop.ShopSpec;
import com.mvp.shq.washer.entity.shop.CompanyProductRelative;

import com.shq.mymvp.dao.NewsDao;
import com.shq.mymvp.dao.ProductDao;
import com.shq.mymvp.dao.ProductCommentDao;
import com.shq.mymvp.dao.ShopAttrDao;
import com.shq.mymvp.dao.ShopSpecDao;
import com.shq.mymvp.dao.CompanyProductRelativeDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig newsDaoConfig;
    private final DaoConfig productDaoConfig;
    private final DaoConfig productCommentDaoConfig;
    private final DaoConfig shopAttrDaoConfig;
    private final DaoConfig shopSpecDaoConfig;
    private final DaoConfig companyProductRelativeDaoConfig;

    private final NewsDao newsDao;
    private final ProductDao productDao;
    private final ProductCommentDao productCommentDao;
    private final ShopAttrDao shopAttrDao;
    private final ShopSpecDao shopSpecDao;
    private final CompanyProductRelativeDao companyProductRelativeDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        newsDaoConfig = daoConfigMap.get(NewsDao.class).clone();
        newsDaoConfig.initIdentityScope(type);

        productDaoConfig = daoConfigMap.get(ProductDao.class).clone();
        productDaoConfig.initIdentityScope(type);

        productCommentDaoConfig = daoConfigMap.get(ProductCommentDao.class).clone();
        productCommentDaoConfig.initIdentityScope(type);

        shopAttrDaoConfig = daoConfigMap.get(ShopAttrDao.class).clone();
        shopAttrDaoConfig.initIdentityScope(type);

        shopSpecDaoConfig = daoConfigMap.get(ShopSpecDao.class).clone();
        shopSpecDaoConfig.initIdentityScope(type);

        companyProductRelativeDaoConfig = daoConfigMap.get(CompanyProductRelativeDao.class).clone();
        companyProductRelativeDaoConfig.initIdentityScope(type);

        newsDao = new NewsDao(newsDaoConfig, this);
        productDao = new ProductDao(productDaoConfig, this);
        productCommentDao = new ProductCommentDao(productCommentDaoConfig, this);
        shopAttrDao = new ShopAttrDao(shopAttrDaoConfig, this);
        shopSpecDao = new ShopSpecDao(shopSpecDaoConfig, this);
        companyProductRelativeDao = new CompanyProductRelativeDao(companyProductRelativeDaoConfig, this);

        registerDao(News.class, newsDao);
        registerDao(Product.class, productDao);
        registerDao(ProductComment.class, productCommentDao);
        registerDao(ShopAttr.class, shopAttrDao);
        registerDao(ShopSpec.class, shopSpecDao);
        registerDao(CompanyProductRelative.class, companyProductRelativeDao);
    }
    
    public void clear() {
        newsDaoConfig.clearIdentityScope();
        productDaoConfig.clearIdentityScope();
        productCommentDaoConfig.clearIdentityScope();
        shopAttrDaoConfig.clearIdentityScope();
        shopSpecDaoConfig.clearIdentityScope();
        companyProductRelativeDaoConfig.clearIdentityScope();
    }

    public NewsDao getNewsDao() {
        return newsDao;
    }

    public ProductDao getProductDao() {
        return productDao;
    }

    public ProductCommentDao getProductCommentDao() {
        return productCommentDao;
    }

    public ShopAttrDao getShopAttrDao() {
        return shopAttrDao;
    }

    public ShopSpecDao getShopSpecDao() {
        return shopSpecDao;
    }

    public CompanyProductRelativeDao getCompanyProductRelativeDao() {
        return companyProductRelativeDao;
    }

}
